
<!DOCTYPE html>
<head>

    <!-- Meta -->
    <meta charset="utf-8">
    <meta name="keywords" content="HTML5 Template" />
    <meta name="description" content="">
    <meta name="author" content="">

    <title>Doozy | Responsive Ecommerce Portfolio Theme</title>

    <!-- Mobile Metas -->
    <meta name="viewport" content="width=device-width, initial-scale=1.0">

    <!-- Favicon -->
    <link rel="shortcut icon" href="/favicon.ico">

    <!-- Google Webfont -->
    <link href="font-awesome-4.2.0/css/font-awesome.min.css" rel="stylesheet" type="text/css">
    <link href='http://fonts.googleapis.com/css?family=Courgette' rel='stylesheet' type='text/css'>
    <link href='http://fonts.googleapis.com/css?family=Noto+Sans:400,400italic,700,700italic' rel='stylesheet' type='text/css'>

    <!-- CSS -->
    <link rel="stylesheet" href="css/bootstrap.css">
    <link rel="stylesheet" href="js/vendor/slick/slick.css">
    <link rel="stylesheet" href="css/prettyphoto.css">
    <link rel="stylesheet" href="js/vendor/owl-carousel/owl.carousel.css">
    <link rel="stylesheet" href="js/vendor/owl-carousel/owl.theme.css">
    <link rel="stylesheet" href="js/vendor/owl-carousel/owl.transitions.css">
    <link rel="stylesheet" href="css/style.css">
    <link rel="stylesheet" href="css/index.css">

    <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
    <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
    <script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->

</head>
<body>

<div class="body">
    <!-- TOPBAR -->
    <div class="topbar">
        <div class="container">
            <div class="row">
                <div class="col-md-12">
                    <ul>
                        <li><a href="./myaccount.html">我的账户</a></li>
                        <li><a href="./wishlist_noproducts.html">愿望单</a></li>
                        <li><a href="./checkout.html">付款</a></li>
                    </ul>
                </div>
            </div>
        </div>
    </div>

    <!-- HEADER -->
    <div class="header">
        <header>
            <div class="container">
                <div class="row">
                    <div class="col-md-4 logo">
                        <a href="#"><img src="images/logo.png" class="img-responsive" alt=""/></a>
                    </div>
                    <div class="col-md-8">
                        <div class="cart-main">
                            <a class="shop-cart"><i class="fa fa-shopping-cart"></i>购物车</a>
                            <div id="cart-main">
                                <ul>
                                    <li>
                                        <img src="images/xtra/3.jpg" alt="" />
                                        <div class="description">
                                            <div class="closeit">X</div>

                                            <a href="./product_single.html">Dolore Vertyusa&reg; Blue navy</a>
                                            <div class="position"><p><span class="currency"><span>$</span>45.99</span><span class="sign">x</span><input type="text" value="1" /></p></div>
                                        </div>
                                        <div class="clearfix"></div>
                                    </li>
                                    <li>
                                        <img src="images/xtra/4.jpg" alt="" />
                                        <div class="description">
                                            <div class="closeit">X</div>

                                            <a href="./product_single.html">Kids' New Balance&reg; for crewkits K1300 sneakers</a>
                                            <div class="position"><p><span class="currency"><span>$</span>59.99</span><span class="sign">x</span><input type="text" value="1" /></p></div>
                                        </div>
                                        <div class="clearfix"></div>
                                    </li>
                                    <li>
                                        <img src="images/xtra/5.jpg" alt="" />
                                        <div class="description">
                                            <div class="closeit">X</div>

                                            <a href="./product_single.html">Girls' Vans&reg; classic slip-on sneakers</a>
                                            <div class="position"><p><span class="currency"><span>$</span>37</span><span class="sign">x</span><input type="text" value="1" /></p></div>
                                        </div>
                                        <div class="clearfix"></div>
                                    </li>
                                </ul>
                                <div class="bottom">
                                    <span class="total">Total: $231</span>
                                    <div class="clearfix"></div>
                                    <a href="./cart.html">结账 <i class="fa fa-angle-right"></i></a>
                                </div>
                            </div>
                        </div>

                        <form class="search">
                            <input type="search" placeholder="搜索商品">
                            <button type="submit"><i class="fa fa-search"></i></button>
                        </form>
                    </div>
                </div>
            </div>
        </header>

        <!-- NAVMENU -->
        <nav class="container">
            <div id='navmenu'>
                <ul>
                    <li><a href='./index.html'>首页</a></li>
                    <li><a href='./shop-grid.html'>商城</a></li>
                    <li class='has-sub'>
                        <a href='#'>团队</a>
                        <ul>
                            <li><a href='./team.html'>队伍</a></li>
                            <li><a href='./team_member.html'>成员</a></li>
                        </ul>
                    </li>
                    <li><a href='./contact.html'>联系我们</a></li>
                </ul>
            </div>
        </nav>
    </div>

    <div class="clearfix space50"></div>

    <!-- LOGIN CONTENT -->
    <div class="container main-content">
        <div class="row">
            <ul class="bcrumbs">
                <li><a href="#"><i class="fa fa-home"></i></a></li>
                <li><span>登陆</span></li>
            </ul>

            <div class="clearfix space30"></div>

            <div id="logreg-content">
                <div class="row">
                    <div class="col-md-5">
                        <div class="logreg-info">
                            <h5>您选择Duang的原因</h5>
                            <ul>
                                <li>物美价廉的商品</li>
                                <li>自由的浏览方式</li>
                                <li>高效的订购流程</li>
                                <li>精美的界面设计</li>
                                <li>友好的咨询服务</li>
                                <li>良好的售后服务</li>
                                <li>丰富的商品资源</li>
                                <li>贴心的智能化推荐</li>
                                <li>全球化服务</li>
                                <li>丰富的管理经验</li>
                            </ul>
                        </div>
                    </div>

                    <div class="col-md-7">
                        <div class="logreg-form" >
                            <h5>登陆 <span>还未注册？ <a href="signup.html">点此注册</a></span></h5>
                            <form class="login-form" method = "post" action = "">
                                <label>电话号码<span>*</span></label>
                                <input type="text" id = "username" name = "username">
                                <label>密码<span>*</span></label>
                                <input type="password" id = "password" name = "password">
                                <div class="cbox">
                                    <input type="checkbox" name="checkboxG1" id="checkboxG1" class="css-checkbox" /><label for="checkboxG1" class="css-label1">显示密码</label>
                                </div>
                                <div class="clearfix"></div>
                                <div id = "error"></div>
                                <button class="pull-right" type="submit">登录</button>
                            </form>
                        </div>
                    </div>
                </div>
            </div>
            <div class="clearfix space30"></div>
        </div>
    </div>
</div>

<div class="clearfix space80"></div>

</div>

<!-- jQuery -->
<script src="js/jquery.min.js"></script>
<script src="js/bootstrap.min.js"></script>
<script src="js/vendor/slick/slick.js"></script>
<script src="js/vendor/isotope/isotope.pkgd.js"></script>
<script src="js/vendor/owl-carousel/owl.carousel.js"></script>
<script src="js/jquery.appear.js"></script>
<script src="js/jquery.inview.js"></script>
<script src="js/jquery-ui.js"></script>
<script src="js/vendor/flex-slider/jquery.flexslider.js"></script>
<script src="js/vendor/flex-slider/main.js"></script>
<script type="text/javascript" src="js/jquery.countdown.js"></script>
<script src="js/jquery.prettyphoto.js"></script>
<script src="js/main.js"></script>
<script src="js/jquery.form.js"></script>
<script type="text/javascript">
    $(function(){
        var login_form = $(".login-form:first");
        var options = {
            url: "/login",
            method: "POST",
            dataType: "json",
            beforeSubmit: function(formData, jqForm) {
                if(!validateUsername(formData[0].value)) {
                    jqForm.eq(0).addClass("unvalid");
                    $("#error").html("<span style='color:red;'>账号格式不符合要求</span>");
                    return false;
                }
            },
            success: function(responseText) {
                var status = responseText.status;
                if(101 == parseInt(status)) {
                    $("#error").html("<span style='color:red;'>用户名或密码错误</span>");
                }
                else if(200 == parseInt(status)) {
                    window.location.href = "index1.jsp";
                }
            }
        };
        login_form.ajaxForm(options);

        showPassword();
    });

    function showPassword(){
        $("#checkboxG1").change(function () {
            var password = $("#password");
            if($(this).is(':checked')){
                password.attr("type","text");
            }else {
                password.attr("type","password");
            }
        });
    }

    function validateUsername(username){
        var regu = /^[1][0-9][0-9]{9}$/;
        var re = new RegExp(regu);
        return re.test(username);
    }

</script>
</body>
</html>
